package timing.ukulele.component;

import org.apache.pivot.beans.BXMLSerializer;
import org.apache.pivot.collections.Map;
import org.apache.pivot.serialization.SerializationException;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.DesktopApplicationContext;
import org.apache.pivot.wtk.Display;
import org.apache.pivot.wtk.Window;

import java.io.IOException;

public class ActivityIndicatorApp implements Application {
    private Window window = null;//窗口

    public static void main(String[] args) {
        DesktopApplicationContext.main(ActivityIndicatorApp.class, args);
    }

    @Override
    public void startup(Display display, Map<String, String> map) throws IOException, SerializationException {
        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (Window) bxmlSerializer.readObject(ActivityIndicatorApp.class, "/activity-indicators.bxml");
        window.open(display);
    }

    @Override
    public boolean shutdown(boolean b) {
        if (window != null) {
            window.close();//关闭窗口
        }
        return false;
    }

    @Override
    public void suspend() {

    }

    @Override
    public void resume() {

    }
}
